<%@page import="web.Form"%>
<%@page import="web.ServletUtilMethods"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>
<%@page import="domain.Student"%>
<%@page pageEncoding="UTF-8" %>



<jsp:include page="/WEB-INF/jspf/lefter.jspf"/>
<div id="container">
    <h1>Редактирование студента</h1>
    <button type="button" onclick="myFunction()">Click Me!</button>
    <jsp:useBean id="bean" class="domain.Student" scope="request"/>



    <TABLE>
        <FORM id="StudentOld" name='StudentOld' action='SaveStudent' method='POST'>
            <!--input type="hidden" name="action" value="${param.action}" /-->

            <tr><td><fmt:message key='id'/></td><td><INPUT type='text' name='id' readonly='readonly' size='40' value='${bean.id}'></td></tr>
            <tr><td><fmt:message key='sex'/></td><td>Муж.<INPUT type='radio' name='sex' value='1' <c:if test="${bean.sex.id == 1}" >checked</c:if>>Жен.<INPUT type='radio' name='sex' value='2' <c:if test="${bean.sex.id == 2}" >checked</c:if>>
            <tr><td><fmt:message key='lastNameRu'/></td><td><INPUT id='lastNameRu' style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='lastNameRu' size='40' value='${bean.lastNameRu}'></td></tr>
            <tr><td><fmt:message key='firstNameRu'/></td><td><INPUT style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='firstNameRu' size='40' value='${bean.firstNameRu}'></td></tr>
            <tr><td><fmt:message key='patronicNameRu'/></td><td><INPUT style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='patronicNameRu' size='40' value='${bean.patronicNameRu}'></td></tr>
            <tr><td><fmt:message key='lastNameEn'/></td><td><INPUT style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='lastNameEn' size='40' value='${bean.lastNameEn}'></td></tr>
            <tr><td><fmt:message key='firstNameEn'/></td><td><INPUT style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='firstNameEn' size='40' value='${bean.firstNameEn}'></td></tr>
            <tr><td><fmt:message key='patronicNameEn'/></td><td><INPUT maxlength='40' type='text' name='patronicNameEn' size='40' value='${bean.patronicNameEn}'></td></tr>
            <tr><td><fmt:message key='dateOfBirth'/></td><td><INPUT type='text' name='dateOfBirth' size='40' value='<fmt:formatDate type="date" dateStyle="medium"  value="${bean.dateOfBirth}" />'></td></tr>
            <tr><td><fmt:message key='emailOffice'/></td><td><INPUT  style='background-color: antiquewhite' class='inpReq' maxlength='40' type='text' name='emailOffice' size='40' value='${bean.emailOffice}'></td></tr>
            <tr><td><fmt:message key='emailHome'/></td><td><INPUT maxlength='40' type='text' name='emailHome' size='40' value='${bean.emailHome}'></td></tr>
            <tr><td><fmt:message key='emailAdd'/></td><td><INPUT id='emailAdd' maxlength='40' type='text' name='emailAdd' size='40' value='${bean.emailAdd}'></td></tr>
            <tr><td><fmt:message key='phoneHome'/></td><td><INPUT id='phoneHome' maxlength='40' type='text' name='phoneHome' size='40' value='${bean.phoneHome}'></td></tr>
            <tr><td><fmt:message key='phoneMobile1'/></td><td><INPUT maxlength='40' type='text' name='phoneMobile1' size='40' value='${bean.phoneMobile1}'></td></tr>
            <tr><td><fmt:message key='phoneMobile2'/></td><td><INPUT maxlength='40' type='text' name='phoneMobile2' size='40' value='${bean.phoneMobile2}'></td></tr>
            <tr><td><fmt:message key='phoneOffice'/></td><td><INPUT maxlength='40' type='text' name='phoneOffice' size='40' value='${bean.phoneOffice}'></td></tr>
            <tr><td><fmt:message key='skype'/></td><td><INPUT maxlength='40' type='text' name='skype' size='40' value='${bean.skype}'></td></tr>
            <tr><td><fmt:message key='icq'/></td><td><INPUT maxlength='40' type='text' name='icq' size='40' value='${bean.icq}'></td></tr>
            <tr><td><fmt:message key='mailruAgent'/></td><td><INPUT maxlength='40' type='text' name='mailruAgent' size='40' value='${bean.mailruAgent}'></td></tr>
            <tr><td><fmt:message key='comments'/></td><td><INPUT maxlength='100' type='text' name='comments' size='40' value='${bean.comments}'></td></tr>
            <tr><td><fmt:message key='photo'/></td><td><INPUT maxlength='40' type='text' name='photo' size='40' value='${bean.photo}'></td></tr>
            <tr><td><fmt:message key='personVueIdent'/></td><td><INPUT maxlength='40' type='text' name='personVueIdent' size='40' value='${bean.personVueIdent}'></td></tr>
            <tr><td><fmt:message key='prometricIdent'/></td><td><INPUT maxlength='40' type='text' name='prometricIdent' size='40' value='${bean.prometricIdent}'></td></tr>
            <tr><td><fmt:message key='oracleLogin'/></td><td><INPUT maxlength='40' type='text' name='oracleLogin' size='40' value='${bean.oracleLogin}'></td></tr>
            <tr><td><fmt:message key='microsoftLogin'/></td><td><INPUT maxlength='40' type='text' name='microsoftLogin' size='40' value='${bean.microsoftLogin}'></td></tr>
            <tr><td><fmt:message key='user'/></td><td><INPUT maxlength='20' type='text' name='user' size='40' value='${bean.user}'></td></tr>
            <tr><td><fmt:message key='insertDatetime'/></td><td><INPUT style='background-color: antiquewhite' class='inpReq' type='text' name='insertDatetime' size='40' value='<fmt:formatDate type="date" dateStyle="medium"  value="${bean.insertDatetime}" />'></td></tr>
            <tr><td><INPUT type='submit' name='submitButton' style='width:150px;height:30px' value='Сохранить'></td>
                <td><INPUT type='reset' style='width:150px;height:30px'  value='Очистить'></td></tr>
        </FORM>
    </TABLE>

    <TABLE>
        <FORM id='Student' name='Student' action='SaveStudent' method='POST'>
            <tr><td><fmt:message key='emailAdd'/></td><td><INPUT id='emailAdd111' maxlength='40' type='text' name='emailAdd111' size='40' value='${bean.emailAdd}'></td></tr>
            <tr><td><fmt:message key='phoneHome'/></td><td><INPUT id='phoneHome111' maxlength='40' type='text' name='phoneHome111' size='40' value='${bean.phoneHome}'></td></tr>
            <tr><td><INPUT type='submit' name='submitButton' style='width:150px;height:30px' value='Сохранить'></td>
                <td><INPUT type='reset' style='width:150px;height:30px'  value='Очистить'></td></tr>
        </FORM>
    </TABLE>

    <%        // Form form = new Form("Student", request, this);
        //out.print(form.getForm());
    %>
    <%-- 
    <form name="studentEdit" action="SaveStudent" method="POST">

        <table>
            <tr>
                <td>ID:</td>
                <td><input type="text" name="id" value="${student.id}" readonly="1" /></td>
            </tr>
            <tr>
                <td> <fmt:message key='lastNameRu'/></td>
                <td><input type="text" name="lastName" value="${student.lastNameRu}" size="30" /></td>
            </tr>
            <tr>
                <td>Имя</td>
                <td><input type="text" name="firstName" value="${student.firstNameRu}" size="30" /></td>
            </tr>
            <tr>
                <td>Эл. почта</td>
                <td><input type="text" name="email" value="${student.emailOffice}" size="30" /></td>
            </tr>
            <tr>
                <td>Дата рождения</td>
    --%>
    <%-- 
<td> <input type="text" name="dateOfBirth" value="${student.dateOfBirth}" size="30" /></td>
    --%>
    <%-- 
              <td> <input type="text" name="dateOfBirth" value="<%= student.getDateOfBirth() == null ? "" : ServletUtilMethods.getStringFromDate(student.getDateOfBirth())%>" size="30" /></td>

            </tr>
            <tr>
                <td>
                    <input type="submit" value="Сохранить"/>
                </td>
                <td>
                    <input type="reset" value="Очистить"/>
                </td>
            </tr>
        </table>

        <input type="hidden" name="action" value="${param.action}" />
    </form>
    --%>
</div>





